{include file="public/layout" /}
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 
	<span class="c-gray en">&gt;</span> 短信模板管理 
	<span class="c-gray en">&gt;</span> 短信模板列表 
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container" style="margin-top: 20px;">
	<div class="cl pd-5 bg-1 bk-gray">
		<span class="l"><a class="btn btn-primary radius" href="/Admin/sms/sms_info"><i class="Hui-iconfont">&#xe600;</i> 添加短信</a> </span> 
	</div>
	<table class="table table-border table-bordered table-hover table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="7">短信模板管理</th>
			</tr>
			<tr class="text-c">
				<th width="25"><input type="checkbox" value="" name=""></th>
				<th width="40">ID</th>
				<th width="200">应用场景</th>
				<th width="200">短信签名</th>
				{if $sms_platform == 1}
				<th width="200">短信模板ID</th>
				{/if}
				<th width="300">发送短信的内容</th>
				<th width="70">操作</th>
			</tr>
		</thead>
		<tbody>
			{if isset($list)}
				{foreach name="list" item="vo" key="k" }
				<tr class="text-c">
					<td><input type="checkbox" value="" name=""></td>
					<td>{$vo.tpl_id}</td>
					<td>{$scene[$vo['send_scene']][0] ? $scene[$vo['send_scene']][0] : ''}</td>
					<td>{$vo.sms_sign}</td>
					{if $sms_platform == 1}
					<td><a>{$vo.sms_tpl_code}</a></td>
					{/if}
					<td>{$vo.content}</td>
					<td class="f-14">
						<a title="编辑" href="/Admin/sms/sms_info?tpl_id={$vo.tpl_id}" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a> 
						<a title="删除" href="javascript:;" onclick="del(this)" data-url="/Admin/sms/del" data-id="{$vo.tpl_id}" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
					</td>
				</tr>
				{/foreach}
			{/if}
		</tbody>
	</table>
</div>
{include file="public/footer" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/public/h-ui.admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript">
/*管理员-角色-删除*/
function del(obj){
	layer.confirm('删除须谨慎，确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: $(obj).attr('data-url'),
			data:{tpl_id: $(obj).attr('data-id')},
			dataType: 'json',
			success: function(data){
				$(obj).parents("tr").remove();
				layer.msg('已删除!',{icon:1,time:1000});
			},
			error:function(data) {
				console.log(data.msg);
			},
		});		
	});
}
</script>
</body>
</html>